import icecream
import numpy as np
# from icecream import icecream
#
# x = [6,7,8,9]  # 4*3
# y = [0,1,2,3]  # 1*4
#
# icecream.ic(x)
# icecream.ic(y)
#
# c = np.column_stack((x,y))  # 将y添加到x的最后一列 4*4
# np.random.shuffle(c)
#
# icecream.ic(c)
# # icecream.ic(y)
#
# m = c[:,:-1].flatten() # 乱序后的x
# n = c[:,-1]  # 同等乱序后的y
#
# icecream.ic(m)
# icecream.ic(n)
#
# l = []
# j = []
# for i in m:
#     l[i] = x[i]
#
# for i in n:
#     j[i] = y[i]
#
# icecream.ic(l)
# icecream.ic(j)
import torch

outputs = torch.tensor([0.2,0.8])
# targets = torch.tensor([1,1,0])

_, preds = torch.max(outputs, 0)
# torch.sum(preds.view(-1) == targets.view(-1))
# equal       = torch.sum(preds.view(-1) == targets.view(-1))
# preds = preds.view(-1)
icecream.ic(preds.item())
# accuracy    = equal/targets.__len__()
#
# icecream.ic(accuracy)